import * as constants from '../Constants'
import { get, GET_AUDITION_LIST } from '../../service/api'

export interface GetAuditionList {
  type: constants.GetAuditionList
  payload: Promise<any>
}
export interface GetAuditionList_PENDING {
  type: constants.GetAuditionList_PENDING
  payload: Promise<any>
}
export interface GetAuditionList_FULFILLED {
  type: constants.GetAuditionList_FULFILLED
  payload: any
}
export interface GetAuditionList_Type {
  type: constants.GetAuditionList_Type
  payload: number
}


export type AuditionAction = GetAuditionList | 
  GetAuditionList_FULFILLED | 
  GetAuditionList_PENDING |
  GetAuditionList_Type

export function recordType(param: number): GetAuditionList_Type {
  return {
    type: constants.GetAuditionList_Type,
    payload: param
  }
}

export function getAuditionList(param: any): GetAuditionList {
  return {
    type: constants.GetAuditionList,
    payload: get(GET_AUDITION_LIST, param)
  }
}